package cn.webrx.coll;/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */

import java.util.TreeMap;

/**
 * <p>Project: jse2204 - cn.webrx.coll.TreeMapDemo
 * <p>Powered by webrx On 2022-09-20 09:56:30
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class TreeMapDemo {
    public static void main(String[] args) {
        TreeMap<Integer, String> tset = new TreeMap<>((a, b) -> b - a);
        tset.put(1, "java");
        tset.put(20, "php");
        tset.put(3, "mysql");
        tset.put(9, "python");
        tset.putIfAbsent(1, "javascript");

        System.out.println(tset);
    }
}
